Optimal. Leaf size=107 \[ -\frac {b^2}{2 c d^2 (1+c x)}+\frac {b^2 \tanh ^{-1}(c x)}{2 c d^2}-\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (1+c x)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {6065, 6063,
641, 46, 213, 6095} \begin {gather*} -\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (c x+1)}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (c x+1)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {b^2}{2 c d^2 (c x+1)}+\frac {b^2 \tanh ^{-1}(c x)}{2 c d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 46
Rule 213
Rule 641
Rule 6063
Rule 6065
Rule 6095
Rubi steps
\begin {align*} \int \frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{(d+c d x)^2} \, dx &=-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}+\frac {(2 b) \int \left (\frac {a+b \tanh ^{-1}(c x)}{2 d (1+c x)^2}-\frac {a+b \tanh ^{-1}(c x)}{2 d \left (-1+c^2 x^2\right )}\right ) \, dx}{d}\\ &=-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}+\frac {b \int \frac {a+b \tanh ^{-1}(c x)}{(1+c x)^2} \, dx}{d^2}-\frac {b \int \frac {a+b \tanh ^{-1}(c x)}{-1+c^2 x^2} \, dx}{d^2}\\ &=-\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (1+c x)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}+\frac {b^2 \int \frac {1}{(1+c x) \left (1-c^2 x^2\right )} \, dx}{d^2}\\ &=-\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (1+c x)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}+\frac {b^2 \int \frac {1}{(1-c x) (1+c x)^2} \, dx}{d^2}\\ &=-\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (1+c x)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}+\frac {b^2 \int \left (\frac {1}{2 (1+c x)^2}-\frac {1}{2 \left (-1+c^2 x^2\right )}\right ) \, dx}{d^2}\\ &=-\frac {b^2}{2 c d^2 (1+c x)}-\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (1+c x)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}-\frac {b^2 \int \frac {1}{-1+c^2 x^2} \, dx}{2 d^2}\\ &=-\frac {b^2}{2 c d^2 (1+c x)}+\frac {b^2 \tanh ^{-1}(c x)}{2 c d^2}-\frac {b \left (a+b \tanh ^{-1}(c x)\right )}{c d^2 (1+c x)}+\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c d^2}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{c d^2 (1+c x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.07, size = 124, normalized size = 1.16 \begin {gather*} \frac {-4 a^2-4 a b-2 b^2-4 b (2 a+b) \tanh ^{-1}(c x)+2 b^2 (-1+c x) \tanh ^{-1}(c x)^2-b (2 a+b) (1+c x) \log (1-c x)+2 a b \log (1+c x)+b^2 \log (1+c x)+2 a b c x \log (1+c x)+b^2 c x \log (1+c x)}{4 c d^2 (1+c x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(293\) vs.
\(2(101)=202\).
time = 0.30, size = 294, normalized size = 2.75
method | result | size |
risch | \(\frac {b^{2} \left (c x -1\right ) \ln \left (c x +1\right )^{2}}{8 d^{2} \left (c x +1\right ) c}-\frac {b \left (b c x \ln \left (-c x +1\right )-b \ln \left (-c x +1\right )+4 a +2 b \right ) \ln \left (c x +1\right )}{4 d^{2} \left (c x +1\right ) c}+\frac {b^{2} c x \ln \left (-c x +1\right )^{2}+4 \ln \left (-c x -1\right ) a b c x +2 \ln \left (-c x -1\right ) b^{2} c x -4 \ln \left (c x -1\right ) a b c x -2 \ln \left (c x -1\right ) b^{2} c x -b^{2} \ln \left (-c x +1\right )^{2}+4 \ln \left (-c x -1\right ) a b +2 b^{2} \ln \left (-c x -1\right )-4 a b \ln \left (c x -1\right )-2 b^{2} \ln \left (c x -1\right )+8 b \ln \left (-c x +1\right ) a +4 b^{2} \ln \left (-c x +1\right )-8 a^{2}-8 a b -4 b^{2}}{8 d^{2} \left (c x +1\right ) c}\) | \(261\) |
derivativedivides | \(\frac {-\frac {a^{2}}{d^{2} \left (c x +1\right )}-\frac {b^{2} \arctanh \left (c x \right )^{2}}{d^{2} \left (c x +1\right )}-\frac {b^{2} \arctanh \left (c x \right ) \ln \left (c x -1\right )}{2 d^{2}}-\frac {b^{2} \arctanh \left (c x \right )}{d^{2} \left (c x +1\right )}+\frac {b^{2} \arctanh \left (c x \right ) \ln \left (c x +1\right )}{2 d^{2}}+\frac {b^{2} \ln \left (c x -1\right ) \ln \left (\frac {c x}{2}+\frac {1}{2}\right )}{4 d^{2}}-\frac {b^{2} \ln \left (c x -1\right )^{2}}{8 d^{2}}-\frac {b^{2} \ln \left (c x -1\right )}{4 d^{2}}-\frac {b^{2}}{2 d^{2} \left (c x +1\right )}+\frac {b^{2} \ln \left (c x +1\right )}{4 d^{2}}-\frac {b^{2} \ln \left (-\frac {c x}{2}+\frac {1}{2}\right ) \ln \left (\frac {c x}{2}+\frac {1}{2}\right )}{4 d^{2}}+\frac {b^{2} \ln \left (-\frac {c x}{2}+\frac {1}{2}\right ) \ln \left (c x +1\right )}{4 d^{2}}-\frac {b^{2} \ln \left (c x +1\right )^{2}}{8 d^{2}}-\frac {2 a b \arctanh \left (c x \right )}{d^{2} \left (c x +1\right )}-\frac {a b \ln \left (c x -1\right )}{2 d^{2}}-\frac {a b}{d^{2} \left (c x +1\right )}+\frac {a b \ln \left (c x +1\right )}{2 d^{2}}}{c}\) | \(294\) |
default | \(\frac {-\frac {a^{2}}{d^{2} \left (c x +1\right )}-\frac {b^{2} \arctanh \left (c x \right )^{2}}{d^{2} \left (c x +1\right )}-\frac {b^{2} \arctanh \left (c x \right ) \ln \left (c x -1\right )}{2 d^{2}}-\frac {b^{2} \arctanh \left (c x \right )}{d^{2} \left (c x +1\right )}+\frac {b^{2} \arctanh \left (c x \right ) \ln \left (c x +1\right )}{2 d^{2}}+\frac {b^{2} \ln \left (c x -1\right ) \ln \left (\frac {c x}{2}+\frac {1}{2}\right )}{4 d^{2}}-\frac {b^{2} \ln \left (c x -1\right )^{2}}{8 d^{2}}-\frac {b^{2} \ln \left (c x -1\right )}{4 d^{2}}-\frac {b^{2}}{2 d^{2} \left (c x +1\right )}+\frac {b^{2} \ln \left (c x +1\right )}{4 d^{2}}-\frac {b^{2} \ln \left (-\frac {c x}{2}+\frac {1}{2}\right ) \ln \left (\frac {c x}{2}+\frac {1}{2}\right )}{4 d^{2}}+\frac {b^{2} \ln \left (-\frac {c x}{2}+\frac {1}{2}\right ) \ln \left (c x +1\right )}{4 d^{2}}-\frac {b^{2} \ln \left (c x +1\right )^{2}}{8 d^{2}}-\frac {2 a b \arctanh \left (c x \right )}{d^{2} \left (c x +1\right )}-\frac {a b \ln \left (c x -1\right )}{2 d^{2}}-\frac {a b}{d^{2} \left (c x +1\right )}+\frac {a b \ln \left (c x +1\right )}{2 d^{2}}}{c}\) | \(294\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 277 vs.
\(2 (101) = 202\).
time = 0.27, size = 277, normalized size = 2.59 \begin {gather*} -\frac {1}{2} \, {\left (c {\left (\frac {2}{c^{3} d^{2} x + c^{2} d^{2}} - \frac {\log \left (c x + 1\right )}{c^{2} d^{2}} + \frac {\log \left (c x - 1\right )}{c^{2} d^{2}}\right )} + \frac {4 \, \operatorname {artanh}\left (c x\right )}{c^{2} d^{2} x + c d^{2}}\right )} a b - \frac {1}{8} \, {\left (4 \, c {\left (\frac {2}{c^{3} d^{2} x + c^{2} d^{2}} - \frac {\log \left (c x + 1\right )}{c^{2} d^{2}} + \frac {\log \left (c x - 1\right )}{c^{2} d^{2}}\right )} \operatorname {artanh}\left (c x\right ) + \frac {{\left ({\left (c x + 1\right )} \log \left (c x + 1\right )^{2} + {\left (c x + 1\right )} \log \left (c x - 1\right )^{2} - 2 \, {\left (c x + {\left (c x + 1\right )} \log \left (c x - 1\right ) + 1\right )} \log \left (c x + 1\right ) + 2 \, {\left (c x + 1\right )} \log \left (c x - 1\right ) + 4\right )} c^{2}}{c^{4} d^{2} x + c^{3} d^{2}}\right )} b^{2} - \frac {b^{2} \operatorname {artanh}\left (c x\right )^{2}}{c^{2} d^{2} x + c d^{2}} - \frac {a^{2}}{c^{2} d^{2} x + c d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 101, normalized size = 0.94 \begin {gather*} \frac {{\left (b^{2} c x - b^{2}\right )} \log \left (-\frac {c x + 1}{c x - 1}\right )^{2} - 8 \, a^{2} - 8 \, a b - 4 \, b^{2} + 2 \, {\left ({\left (2 \, a b + b^{2}\right )} c x - 2 \, a b - b^{2}\right )} \log \left (-\frac {c x + 1}{c x - 1}\right )}{8 \, {\left (c^{2} d^{2} x + c d^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {a^{2}}{c^{2} x^{2} + 2 c x + 1}\, dx + \int \frac {b^{2} \operatorname {atanh}^{2}{\left (c x \right )}}{c^{2} x^{2} + 2 c x + 1}\, dx + \int \frac {2 a b \operatorname {atanh}{\left (c x \right )}}{c^{2} x^{2} + 2 c x + 1}\, dx}{d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 119, normalized size = 1.11 \begin {gather*} \frac {1}{8} \, c {\left (\frac {{\left (c x - 1\right )} b^{2} \log \left (-\frac {c x + 1}{c x - 1}\right )^{2}}{{\left (c x + 1\right )} c^{2} d^{2}} + \frac {2 \, {\left (2 \, a b + b^{2}\right )} {\left (c x - 1\right )} \log \left (-\frac {c x + 1}{c x - 1}\right )}{{\left (c x + 1\right )} c^{2} d^{2}} + \frac {2 \, {\left (2 \, a^{2} + 2 \, a b + b^{2}\right )} {\left (c x - 1\right )}}{{\left (c x + 1\right )} c^{2} d^{2}}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.25, size = 97, normalized size = 0.91 \begin {gather*} \frac {b^2\,{\mathrm {atanh}\left (c\,x\right )}^2+b^2\,\mathrm {atanh}\left (c\,x\right )+2\,a\,b\,\mathrm {atanh}\left (c\,x\right )}{2\,c\,d^2}-\frac {2\,a^2+4\,a\,b\,\mathrm {atanh}\left (c\,x\right )+2\,a\,b+2\,b^2\,{\mathrm {atanh}\left (c\,x\right )}^2+2\,b^2\,\mathrm {atanh}\left (c\,x\right )+b^2}{2\,x\,c^2\,d^2+2\,c\,d^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________